home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / cache2.zip / CACHE2.DOC < prev    next >
Text File  |  1986-01-24  |  4KB  |  92 lines

  1. Purpose:
  2.  
  3.          CACHE establishes disk caches. The default cache is for
  4.          all PC, XT, and AT real (not virtual) drives other than the AT hard 
  5.          disk.  
  6.  
  7. Format:  [d:][path]CACHE [[size] disk]
  8.  
  9. Remarks: Specify the parameters:    
  10.  
  11.          [d:][path] before CACHE to specify the drive and the path that 
  12.          contains the CACHE command file.
  13.  
  14.          [size]     Size of the cache in 512 byte sectors. This number must be
  15.          between 24 and 124, or it will be adjusted. The default is 64.
  16.          The storage occupied by the cache is less than 256 bytes plus
  17.          518 bytes per sector.
  18.  
  19.          [disk]    Disk to be cached, if a single disk cache is being allocated.
  20.          The default is to cache all real disks, but there may be occasions
  21.          where it is desirable to avoid cacheing a specific disk, or a
  22.          cache larger than 62K bytes is desired.
  23.  
  24.          CACHE can be called more than once to create a larger cache or
  25.          set individual disk caches for each disk. The caches are searched in
  26.          reverse order of allocation. If you are allocating more than one cache
  27.          allocate the most heavily used cache LAST. If you are allocating
  28.          a general cache, it makes sense to allocate it FIRST in most cases,
  29.          so it becoems a "cache of last resort". The overhead for skipping
  30.          individual caches is small, but the overhead for a search failure is
  31.          large.
  32.  
  33.          Only single sector reads and writes are cached. Therefore, loading 
  34.          large programs will not be affected. What will be affected are
  35.          databases with records smaller than 512 bytes, batch files, and
  36.          source files for language processors that scan the input file
  37.          more than once. The disk file directory and file allocation tables
  38.          are cached, and always resident once read from disk. Other files
  39.          have their sectors purged if they are not frequenly accessed.
  40.  
  41.          When the cache is allocated, its segment location is listed out.
  42.          The DOS DEBUG command can be used to read out data areas of interest,
  43.          while the cache is running. The data areas start at offset 114h.
  44.          They are each one word (two bytes) long:
  45.                     
  46.                 offset           data
  47.  
  48.                  114      Cache size in sectors
  49.                  116      Total Number of disk I/O's
  50.                  118      Number of cache hits
  51.                  11A      Number of free slots in cache
  52.  
  53.          Remember that these numbers are hexadecimal and stored low order byte 
  54.          first, so the default size of 64 is stored as: 
  55.                         
  56.                            40 00                            
  57.  
  58.          To access this data, first write down the sector address typed
  59.          out when CACHE initializes. Let's say it is 909. Type the following
  60.          commands:
  61.  
  62.          
  63.                            DEBUG
  64.                            d 909:114
  65.                            (analyze the displayed data)
  66.                            q
  67.  
  68.          Typically, the about half of all disk I/O's will result in cache hits. 
  69.          All data in cache is backed up on disk immediately, so only disk reads 
  70.          are assisted by cache. The cache should be sized so that you will not 
  71.          reduce the number of free slots to zero, the first time you perform 
  72.          your most frequent operation. Size your cache by booting your
  73.          computer, issuing the CACHE command for a 124 sector buffer, 
  74.          performing your "typical" batch file, compile or data base access, 
  75.          running DEBUG, determining how much CACHE remains free, and downsizing 
  76.          as required. If you can't allocate a single large cache that does the
  77.          job, then create caches for heavily used disks. 
  78.  
  79.          Place the CACHE commands first in your AUTOEXEC.BAT file because CACHE 
  80.          will make it run faster. Also notice that DIR commands will run 
  81.          without pausing, and the disk will stop running about halfway through 
  82.          the second time it is issued.  
  83.  
  84. From: Quick and Dirty Software, Inc.
  85.       Origional logic by Steven Holzer of PC magazine (8/85)
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.